<?php
require_once 'BaseAction.php';

class Event_CityController extends TTEvent_Base_Action
{
    public function getAction()
    {
    	$this->_helper->Layout->disableLayout();
        $cid = (int)$this->_getParam('cid');
        $cities = array();
        
        if ($cid != 0) {
            $key = 'country_cities_' + $cid;
            $cities = $this->getCache($key);
            if ( ! $cities) {
                $countryModel = $this->loadModel('Country');
                $cities = $countryModel->getCitiesByCountry($cid);    
                $this->setCache($key, $cities);
            }
        }
        $this->view->cities = $cities;
        
    }   
}

